//
//  StatusCell.swift
//  VO_Yuejie
//
//  Created by laichunhui on 15/11/18.
//  Copyright © 2015年 lch. All rights reserved.
//

import UIKit

/// cell间距
let TopicCellMargin: CGFloat = 8

class TopicCell: UITableViewCell {
    /// 整体动画视图
    @IBOutlet weak var animationView: UIView!
    
    /// 时间视图
    @IBOutlet weak var timeView: UIView!

    @IBOutlet weak var yearLabel: UILabel!
    @IBOutlet weak var monthLabel: UILabel!
    @IBOutlet weak var dayLabel: UILabel!
    
    
    @IBOutlet weak var titleLabel: UILabel!
   
   @IBOutlet weak var pictureView: UIImageView!
    
    var viewModel: TopicViewModel? {
        didSet {
            titleLabel.text = viewModel?.title
            
            if let image_url = viewModel?.image_url {
                pictureView.vo_setImageWithURL(image_url, placeholderImage: UIImage(named: "sm_big_topic_default")!)
            }
            
            yearLabel.text = "\(viewModel!.publishAt.year)"
            monthLabel.text = viewModel!.publishAt.en_month
            dayLabel.text = "\(viewModel!.publishAt.days.format("02"))"
            
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
    }

    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        self.selectionStyle = UITableViewCellSelectionStyle.None
    }

}
